import { Rule, RuleType } from '@midwayjs/decorator';
import { BasePageDto } from '../../mall/dto/base';

export class CreateCartDto {
  @Rule(RuleType.number().required())
  customerId: number;

  @Rule(RuleType.number().required())
  productId: number;

  @Rule(RuleType.number().required())
  skuId: number;

  @Rule(RuleType.number().required())
  count: number;
}

export class UpdateCartDto {
  @Rule(RuleType.number().required())
  productId: number;

  @Rule(RuleType.number().required())
  skuId: number;

  @Rule(RuleType.string())
  poster: string;

  @Rule(RuleType.string())
  color: string;

  @Rule(RuleType.string())
  size: string;

  @Rule(RuleType.number())
  price: number;

  @Rule(RuleType.number())
  count: number;
}

// 查询指定顾客、指定 id 的购物车信息
export class CartInfoDto {
  @Rule(RuleType.number().required())
  id: number;

  @Rule(RuleType.number().required())
  customerId: number;
}

// 查询指定顾客的购物车信息
export class CartPageDto extends BasePageDto {
  @Rule(RuleType.number().required())
  customerId: number;
}
